
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace WroxControls 
{

	public class AdaptiveControl: WebControl 
	{

		override protected void Render( HtmlTextWriter objWriter )
		{
		
			objWriter.Write("<BR>");
			objWriter.Write("Browser is: ");
			objWriter.Write(Page.Request.Browser.Browser );
			objWriter.Write("<BR>");

			objWriter.Write("Browser version is: ");
			objWriter.Write(Page.Request.Browser.Version );
			objWriter.Write("<BR>");

			if  ( Page.Request.Browser.JavaScript == true )
			{
				objWriter.Write("Browser supports JavaScript");
			}

			if  ( Page.Request.Browser.VBScript == true )
			{
				objWriter.Write("Browser supports VBScript");
			}

			if  ( Page.Request.Browser.Browser == "IE" ) 
		
			{
				objWriter.Write("<BR>IE rocks!");
			}

			if  ( Page.Request.Browser.Browser == "Netscape" ) 
		
			{
				objWriter.Write("<BR>Netscape rolls!");
			}


			objWriter.Write("<BR>Client target is " + Page.ClientTarget );
		}
         
	}

}